Friends.CheckboxLabel = new function() { this.prefix = 'CheckboxLabel-'; this.createFromTag = function(element, params) { var checkbox = y5.Dom.getDescendant(element, '*', this.prefix + 'Checkbox'); var text = y5.Dom.getDescendant(element, '*', this.prefix + 'Text'); function check(e) { checkbox.checked = (y5.Strings.trim(text.value).length > 0); } y5.Events.create('keyup', check, text, true); }; } y5.require(['Dom', 'Events', 'Strings'], function() {y5.loaded('{Friends}.CheckboxLabel')});